<?php

namespace App\Http\Controllers\Home;

use Illuminate\Http\Request;
use DB;
use App\Http\Requests;
use App\Http\Controllers\Controller;

class PayController extends Controller
{
    
	//显示已完成订单页
	public function pay(){
		$pays = DB::table('order')->where('ostatus','=',3)->paginate(5);
		return view('home.personal.pay',['pays'=>$pays]);
	}
	
	 //删除订单操作
    public function delete(Request $request){
        //接收用户id
        $oid=$request->input('oid');
        //删除操作
        $result=DB::table('order')->where('oid','=',$oid)->delete();

        if($result){
            echo 1;
        }else{
            echo 0;
        }
    }
	
	
}
